home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Webster's Millennium Amer…Sign Language Dictionary
/
ASL.ISO
/
mac
/
SKILLS.dir
/
00071_Script_test Questions
< prev
next >
Wrap
Text File
|
2001-09-05
|
22KB
|
637 lines
on getQuestions
global gDataType,gTestType,gNumQs,gDataSource,gHistoryData,gDownLoads
global gWordList,gAlphabet,gTestList,gTestResults,gTestScore
global scrollList,gGameCat,bad,myAlertWindow,gBackToSetUp, gTestEnd
global gCurrentUser
if gTestType = "multiple choice" then setUpTest
set gTestList = []
set gTestResults = []
set bad = []
set gtestListing = ""
set gBackToSetUp = 0
set gTestEnd = 0
cursor 4
if gDataType = "fs" then
repeat while (count(gTestList) < gNumQs)
put getAt(gAlphabet,random(26)) into aLetter
if getPos(gTestList,aLetter)=0 then
add gTestList,aLetter
set gtestListing = gtestListing&aLetter&return
add gTestResults,"not tested"
end if
end repeat
else
--alertBox "Preparing Questions..."
if gDataSource = "entire dictionary" then
--
repeat while (count(gtestList) < gNumQs)
put getAt(gWordList,random(count(gWordList))) into aWord
if not goodMedia(getPos(gWordList,aWord)) then next repeat
if getPos(gtestList,aWord)=0 then
add gtestList,aWord
set gtestListing = gtestListing&aWord&return
add gTestResults,"not tested"
end if
end repeat
--
else if gDataSource = "category" and not (gGameCat = "") then
----
-- use category words
if gGameCat = "DownLoaded Signs" then
put gDownLoads into catWords
else
--PETEMACK 09.05.01
-- tell window "dData" to put the number of cast (gGameCat&"."&gCurrentUser) into userCat
-- if userCat > 0 then
-- tell window "dData" to put field (gGameCat&"."&gCurrentUser) into catWords
-- else tell window "dData" to put field gGameCat into catWords
set vRandomPick = random(29) --PETEMACK 09.05.01
set vRandomPick = vRandomPick + 30 --PETEMACK 09.05.01
tell window "dData" to set vCatName = the name of member vRandomPick --PETEMACK 09.05.01
alert string(vCatName && "Category Randomly Selected") --PETEMACK 09.05.01
tell window "dData" to put field vRandomPick into catWords --PETEMACK 09.05.01
end if
set catList = getStringToList(catWords)
repeat while (count(gtestList) < gNumQs) and (count(gtestList) < count(catList)-count(bad))
set aWord = getAt(catList,random(count(catList)))
if not goodMedia(getPos(gWordList,aWord)) then
if getPos(bad,aWord) = 0 then add bad, aWord
next repeat
end if
if getPos(gtestList,aWord)=0 then
add gtestList,aWord
set gtestListing = gtestListing&aWord&return
add gTestResults,"not tested"
end if
end repeat
----
else
----
-- use history data = previous sessions, current session or previous test
repeat while (count(gtestList) < gNumQs) and (count(gtestList) < count(gHistoryData)-count(bad))
put getAt(gHistoryData,random(count(gHistoryData))) into aWord
if not goodMedia(getPos(gWordList,aWord)) then
if getPos(bad,aWord) = 0 then add bad, aWord
next repeat
end if
if getPos(gtestList,aWord)=0 then
add gtestList,aWord
set gtestListing = gtestListing&aWord&return
add gTestResults,"not tested"
end if
end repeat
----
end if
---- if history data or category contains less than requested # of questions
---- then fill in with gWordList i.e. entire dictionary
if (count(gtestList) < gNumQs) then
repeat while (count(gtestList) < gNumQs)
put getAt(gWordList,random(count(gWordList))) into aWord
if not goodMedia(getPos(gWordList,aWord)) then next repeat
if getPos(gtestList,aWord)=0 then
add gtestList,aWord
set gtestListing = gtestListing&aWord&return
add gTestResults,"not tested"
end if
end repeat
end if
----
end if
set gTestScore = 0
set the text of cast "testScore" = "Points Scored: "&gTestScore
-- if objectp(myAlertWindow) then
-- close myAlertWindow
-- forget myAlertWindow
-- end if
cursor 0
end getQuestions
on setUpTest
global gNumQs,gGameCat
global maxScroll,minScroll
set minScroll = 1
set maxScroll = gNumQs
set the visible of sprite 25 = false
set the visible of sprite 26 = false
set the visible of sprite 27 = false
set the visible of sprite 28 = false
set the visible of sprite 39 = false
end setUpTest
on aQuestion WhichQuestion
global gTest,gTestType,gGameCat,gDownLoads
global gDataType,gDataSource,bad
global gWordList,gAlphabet,gTestList
global gCurrentQuestion,gNumQs,gHistoryData,gWordList
global gCurrentUser
cursor 4
if WhichQuestion = "" or voidp(WhichQuestion) then exit
--if gTest then
set the text of cast "whichq" = string(integer(whichQuestion))&&"of"&&gNumQs
resetQCasts
set gCurrentQuestion = whichQuestion
if whichQuestion < 1 or whichQuestion > count(gTestList) then exit
set gQuestionList = []
add gQuestionList, getAt(gTestList,whichQuestion)
if gDataType = "fs" then
repeat while (count(gQuestionList) < 4)
put getAt(gAlphabet,random(26)) into aLetter
if getPos(gQuestionList,aLetter)=0 then
add gQuestionList,aLetter
end if
end repeat
else
--••••••••••
-- If a category was chosen then,
-- use category words to fill in the
-- multiple choice sets.
set catList = []
if not (gGameCat = "") and not voidp(gGameCat) then
if gGameCat = "DownLoaded Signs" then
put gDownLoads into catWords
else
tell window "dData" to put the number of cast (gGameCat&"."&gCurrentUser) into userCat
if userCat > 0 then
tell window "dData" to put field (gGameCat&"."&gCurrentUser) into catWords
else tell window "dData" to put field gGameCat into catWords
end if
set catList = getStringToList(catWords)
end if
repeat while (count(gQuestionList) < 4)
-- If a category or history data is used and has less than
-- 10 words, it could be difficult
-- to quickly form unique multiple choice sets.
-- In this case, use the entire dictionary.
-- This problem will only occur where users choose
-- one of their own categories with very few words.
if gDataSource = "entire dictionary" then
put getAt(gWordList,random(count(gWordList))) into aWord
else if gDataSource = "category" and not (gGameCat = "") then
----
-- use category words
if count(catList)-count(bad) < 10 then
put getAt(gWordList,random(count(gWordList))) into aWord
else put getAt(catList,random(count(catList))) into aWord
----
else
----
-- use history data = previous sessions, current session or previous test
if count(gHistoryData)-count(bad) < 10 then
put getAt(gWordList,random(count(gWordList))) into aWord
else put getAt(gHistoryData,random(count(gHistoryData))) into aWord
----
end if
if not goodMedia(getPos(gWordList,aWord)) then next repeat
if getPos(gQuestionList,aWord)=0 then
add gQuestionList,aWord
end if
end repeat
end if
cursor 0
displayQuestion scrambleQ(gQuestionList)
end aQuestion
on aFillInQuestion whichQuestion
global gCurrentQuestion,gNumQs
global TEMPLATE1, KNOB1, minPos1, maxPos1
global maxscroll,minScroll,gCat,ScrollList
set the visible of sprite 39 = false
if whichQuestion > 1 then
put maxscroll*1.0-minScroll*1.0 into scrollRange
put scrollRange/(maxPos1-minPos1) into scrollRatio
put max(integer((maxPos1-minPos1)/scrollRange),1) into sliderRatio
set the locH of sprite KNOB1 = max( minPos1, min( (the locH of sprite KNOB1 + sliderRatio) , maxPos1 ) )
end if
set gCurrentQuestion = whichQuestion
VideoDisplay
set the visible of sprite 39 = true
set the text of cast "whichq" = string(integer(whichQuestion))&&"of"&&gNumQs
end aFillInQuestion
--on checkFillAnswer
-- global gNumQs,gTest,gCLockon,gBackToSetUp
-- global gTestList,gCurrentQuestion,gTestScore
-- put 10 into spriteClicked
-- --put the clickOn into spriteClicked
-- set checkThis = the text of cast "fill-in word"
-- set answerCorrect = EvalFillInAnswer(checkThis,getAt(gTestList,gCurrentQuestion))
--
-- set qStatus = getAt(gTestResults,gCurrentQuestion)
-- if qStatus = "not tested" then set qStatus = "1"
-- else set qStatus = string(integer(qStatus)+1)
--
-- if answerCorrect then
-- if getAt(gTestResults,gCurrentQuestion) contains "Ø" then nothing
-- else setAt(gTestResults,gCurrentQuestion,qStatus&" Ø")
-- rightAnswer spriteClicked
-- put "" into field "fill-in word"
-- set gTestScore = gTestScore+1
-- set the text of cast "testScore" = "Points Scored: "&gTestScore
-- startTimer
-- repeat while the timer < 180 --aTimer = 1 to 3000
-- nothing
-- end repeat
-- else
-- if getAt(gTestResults,gCurrentQuestion) contains "Ø" then nothing
-- else setAt(gTestResults,gCurrentQuestion,qStatus)
-- wrongAnswer spriteClicked
-- put "" into field "fill-in word"
-- startTimer
-- repeat while the timer < 180 --aTimer = 1 to 3000
-- nothing
-- end repeat
-- end if
-- set cstNum = the number of cast "test blank"
-- set the castNum of sprite spriteClicked =cstNum
-- if gCurrentQuestion < gNumQs then
-- put "" into field "fill-in word"
-- aFillInQuestion gCurrentQuestion+1
-- else
-- set gClockon = false
-- if gTest then mouseUp (script "summary script")
-- set gBackToSetUp = 1
-- --
-- end if
--end checkFillAnswer
on checkFillAnswer
global sync
set sync = 1
global gTimeTime, gSeconds
put gSeconds into gTimetime
global gNumQs,gTest,gCLockon,gBackToSetUp,gTestResults,gCurrentQuestion
global gTestList,gCurrentQuestion,gTestScore
put 10 into spriteClicked
--put the clickOn into spriteClicked
set checkThis = the text of cast "fill-in word"
set answerCorrect = EvalFillInAnswer(checkThis,getAt(gTestList,gCurrentQuestion))
set qStatus = getAt(gTestResults,gCurrentQuestion)
if qStatus = "not tested" then set qStatus = "1"
else set qStatus = string(integer(qStatus)+1)
if answerCorrect then
if getAt(gTestResults,gCurrentQuestion) contains "Ø" then nothing
else setAt(gTestResults,gCurrentQuestion,qStatus&" Ø")
rightAnswer spriteClicked
put "" into field "fill-in word"
set gTestScore = gTestScore+1
set the text of cast "testScore" = "Points Scored: "&gTestScore
startTimer
repeat while the timer < 180 --aTimer = 1 to 3000
nothing
end repeat
else
if getAt(gTestResults,gCurrentQuestion) contains "Ø" then nothing
else setAt(gTestResults,gCurrentQuestion,qStatus)
wrongAnswer spriteClicked
put "" into field "fill-in word"
startTimer
repeat while the timer < 180 --aTimer = 1 to 3000
nothing
end repeat
end if
set cstNum = the number of cast "test blank"
set the castNum of sprite spriteClicked =cstNum
if gCurrentQuestion < gNumQs then
put "" into field "fill-in word"
aFillInQuestion gCurrentQuestion+1
else
set gClockon = false
if gTest then mouseUp (script "summary script")
set gBackToSetUp = 1
--
end if
end checkFillAnswer
on EvalFillInAnswer userAnswer,systemAnswer
global gDataType
if gDataType = "fs" then
return (userAnswer=systemAnswer)
else --return (userAnswer=systemAnswer)
tell window "dData" to put the number of cast systemAnswer into RefNum
tell window "dData" to put the text of cast RefNum into dataVar
set the itemdelimiter to "*"
put getXRefs(dataVar) into sharedSigns
set the itemdelimiter to ","
if systemAnswer contains "/" then
set the itemdelimiter to "/"
repeat with i = 1 to the number of items of systemAnswer
put return&item i of systemAnswer after sharedSigns
end repeat
set the itemdelimiter to ","
else put return&systemAnswer after sharedSigns
repeat with i = 1 to the number of lines of sharedSigns
if line i of sharedSigns = "" then next repeat
if stripChars(line i of sharedSigns,userAnswer) = true then return true
end repeat
return (userAnswer=systemAnswer)
end if
end
on stripChars systemData,userAnswer
set strippedSystemData = ""
repeat with i = 1 to the number of chars of systemData
if ("1234567890!@#$%^&*()_+-=[]\{}|;':./<>?~`/""E&TAB) contains char i of systemData then
next repeat
else if not (char i of systemData = " ") then put char i of systemData after strippedSystemData
end repeat
set strippedUserAnswer = ""
repeat with i = 1 to the number of chars of userAnswer
if ("1234567890!@#$%^&*()_+-=[]\{}|;':./<>?~`/""E&TAB) contains char i of userAnswer then
next repeat
else if not (char i of userAnswer = " ") then put char i of userAnswer after strippedUserAnswer
end repeat
return (strippedSystemData=strippedUserAnswer)
end
on displayQuestion qList
setUpTest
repeat with i = 1 to count(qList)
set the text of cast ("word"&&string(i)) = getAt(qList,i)
set vSprite = value(i+24) --PETEMACK 07.05.01
set the visible of sprite vSprite = true --PETEMACK 07.05.01
updatestage
end repeat
videoDisplay
set the visible of sprite 39 = true
end displayQuestion
on scrambleQ TheList
global gCurrentQList
put false into finished
set testList = []
set returnList = []
set returnvals = ""
repeat while not finished
set nextVal = random(count(theList))
if getPos(testList,nextVal) = 0 then
append returnList, getAt(TheList,nextVal)
append testList,nextVal
end if
if count(returnList) = 4 then set finished = true
end repeat
set gCurrentQList = returnList
return returnList
end scrambleQ
--on checkAnswer
-- global gTest,gNumQs,gClockon
-- global gTestList,gTestResults
-- global gCurrentQuestion,gCurrentQList,gTestScore,gBackToSetUp
--
-- sound stop 3
-- resetQCasts
-- put the clickOn into spriteClicked
-- put spriteClicked+14 into textBox
-- if spriteClicked < 29 then
-- put spriteClicked+34 into textBox
-- set spriteClicked=spriteClicked+20
-- end if
-- --put textBox
-- set checkLoc = spriteClicked-28
-- set qStatus = getAt(gTestResults,gCurrentQuestion)
--
-- if qStatus = "not tested" then set qStatus = "1"
-- else set qStatus = string(integer(qStatus)+1)
--
-- if getAt(gCurrentQList,checkLoc) = getAt(gTestList,gCurrentQuestion) then
-- if getAt(gTestResults,gCurrentQuestion) contains "Ø" then nothing
-- else setAt(gTestResults,gCurrentQuestion,qStatus&" Ø")
-- rightAnswer spriteClicked,textBox
-- set gTestScore = gTestScore+1
-- set the text of cast "testScore" = "Points Scored: "&gTestScore
-- if gTest then
-- startTimer
-- repeat while the timer < 180 --aTimer = 1 to 3000
-- nothing
-- end repeat
-- if gCurrentQuestion < gNumQs then aQuestion gCurrentQuestion+1
-- else
-- if gTest then mouseUp (script "summary script")
-- set gBackToSetUp = 1
-- --
-- end if
-- end if
-- --
-- else
-- if getAt(gTestResults,gCurrentQuestion) contains "Ø" then nothing
-- else setAt(gTestResults,gCurrentQuestion,qStatus)
-- wrongAnswer spriteClicked,textBox
-- if gTest then
-- startTimer
-- repeat while the timer < 180 --aTimer = 1 to 3000
-- nothing
-- end repeat
-- if gCurrentQuestion < gNumQs then aQuestion gCurrentQuestion+1
-- else
-- if gTest then mouseUp (script "summary script")
-- set gBackToSetUp = 1
-- --
-- end if
-- end if
-- end if
-- if gCurrentQuestion+1 > gNumQs then
-- if gTest then
-- saveResults
-- set gClockOn = false
-- end if
-- if gTest then set the text of cast "whichq" = "done"
-- end if
--end checkAnswer
on checkAnswer
global sync
set sync = 1
global gTimeTime, gSeconds
put gSeconds into gTimetime
global gTest,gNumQs,gClockon
global gTestList,gTestResults
global gCurrentQuestion,gCurrentQList,gTestScore,gBackToSetUp
sound stop 3
resetQCasts
put the clickOn into spriteClicked
put spriteClicked+14 into textBox
if spriteClicked < 29 then
put spriteClicked+34 into textBox
set spriteClicked=spriteClicked+20
end if
--put textBox
set checkLoc = spriteClicked-28
set qStatus = getAt(gTestResults,gCurrentQuestion)
if qStatus = "not tested" then set qStatus = "1"
else set qStatus = string(integer(qStatus)+1)
if getAt(gCurrentQList,checkLoc) = getAt(gTestList,gCurrentQuestion) then
if getAt(gTestResults,gCurrentQuestion) contains "Ø" then nothing
else setAt(gTestResults,gCurrentQuestion,qStatus&"Ø")
rightAnswer spriteClicked,textBox
set gTestScore = gTestScore+1
set the text of cast "testScore" = "Points Scored: "&gTestScore
if gTest then
startTimer
repeat while the timer < 180 --aTimer = 1 to 3000
nothing
end repeat
if gCurrentQuestion < gNumQs then aQuestion gCurrentQuestion+1
else
set gClockOn = false
if gTest then mouseUp (script "summary script")
set gBackToSetUp = 1
--
end if
end if
--
else
if getAt(gTestResults,gCurrentQuestion) contains "Ø" then nothing
else setAt(gTestResults,gCurrentQuestion,qStatus)
wrongAnswer spriteClicked,textBox
if gTest then
startTimer
repeat while the timer < 180 --aTimer = 1 to 3000
nothing
end repeat
if gCurrentQuestion < gNumQs then aQuestion gCurrentQuestion+1
else
set gClockOn = false
if gTest then mouseUp (script "summary script")
set gBackToSetUp = 1
--
end if
end if
end if
if gCurrentQuestion > gNumQs then --+ 1
if gTest then
saveResults
set gClockOn = false
end if
if gTest then set the text of cast "whichq" = "done"
end if
end checkAnswer
on wrongAnswer spNum,textBox
set response = getAt(["Wrong!","Tough Luck!","Nope!","Wrong one!","Not too good!"],random(5))
if not voidP(textBox) and not (textBox > 46) then
put response into field the castNum of sprite textBox
set the visible of sprite textbox to true
end if
set cstNum = the number of cast "test wrong"
set the castNum of sprite spNum = cstNum
updatestage
end wrongAnswer
on rightAnswer spNum,textBox
set response = getAt(["Right!","Great job!","Wow!","Yeee Haa!","Very Good!"],random(5))
if not voidP(textBox) and not (textBox > 46) then
put response into field the castNum of sprite textBox
set the visible of sprite textbox to true
end if
set cstNum = the number of cast "test right"
set the castNum of sprite spNum = cstNum
updatestage
end rightAnswer
on resetQCasts
set cstNum = the number of cast "test blank"
repeat with i = 29 to 32
set the castNum of sprite i = cstNum
end repeat
repeat with i = 43 to 46
set the visible of sprite i to false
end repeat
updatestage
end resetQCast
on setQCasts
repeat with i = 29 to 32
puppetSprite i,true
end repeat
end setQCasts
on videoDisplay
global gSoundOn
global gTestList,gCurrentQuestion
global gDataType,videoFile,gLoopVideo
set dictRef = getAt(gTestList,gCurrentQuestion)
cursor 4
if gDataType = "fs" then
set cstNum = the number of cast (dictRef&&"bitmap")
set the castNum of sprite 39 = cstNum
set the ink of sprite 39 = 36
else
tell window "dData" to put the text of cast dictRef into DictEntry
set the itemDelimiter to "*"
put item 5 of DictEntry into qtRef
put item 11 of DictEntry into field "hint"
set videoFile = getName(qtRef,"MOVS")
put char 1 to (length(item 8 of DictEntry)-3) of item 8 of DictEntry&"mov" into descSnd
if the machineType = 256 then
set descFile = getName(descSnd,"snds/Desc") --snd expl
else set descFile = getName(descSnd,"snds:Desc") --snd expl
sound stop 3
if not (the filename of cast "sound desc" = descFile) then
set the filename of cast "sound desc" = descFile
end if
set the filename of cast "video" to videoFile
set the itemDelimiter to ","
set the directToStage of cast "video" to true
set the loop of cast "video" to gLoopVideo
set cstNum = the number of cast "video"
if the castNum of sprite 39 <> cstNum then set the castNum of sprite 39 = cstNum
set the ink of sprite 39 = 0
setVideoSpeed --set the movieRate of sprite 39 to 1
if gSoundOn then
sound playfile 3,the filename of cast "sound desc"
end if
end if
updatestage
cursor 0
end videoDisplay